<template>
  <header class="worp">
    <div>
      <img src="../assets/img/indexLogo.6f8ac4f0.png" alt="" />
    </div>
    <ul>
      <li :class="$route.path=='/home'?'active':''" @click="$router.push('/home')">首页</li>
      <li :class="$route.path=='/goods'?'active':''" @click="$router.push('/goods')">全部商品</li>
      <li :class="$route.path=='/user'?'active':''" @click="$router.push('/user')">个人中心</li>
      <li :class="$route.path=='/order'?'active':''" @click="$router.push('/order')">我的订单</li>
      <li :class="$route.path=='/free'?'active':''" @click="$router.push('/free')">专属福利</li>
    </ul>
    <div class="search">
      <input type="text" name="" id="" placeholder="输入关键字" class="ipt" />
      <p class="switchs"><img src="../assets/img/search.png" alt="" /></p>
    </div>
  </header>
</template>

<script>
export default {
  data() {
    return {};
  },
};
</script>
 
<style lang = "less" scoped>
header {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  line-height: 60px;
  align-items: center;

  ul {
    display: flex;
    font-size: 16px;
    font-family: SourceHanSansSC;
    font-weight: 500;
    color: #242b39;
    .active {
      color: #0a328e;
    }
    li {
      margin: 0 30px;
      cursor: pointer;
    }
  }
  .search {
    display: flex;
    .ipt {
      width: 214px;
      height: 40px;
      border: 1px solid #dedede;
      border-radius: 20px 0px 0px 20px;
      padding-left: 10px;
    }
    .switchs {
      width: 50px;
      height: 44px;
      background: #0a328e;
      border-radius: 0px 20px 20px 0px;
      text-align: center;
      line-height: 51px;
      cursor: pointer;
    }
  }
}
</style>